// ----------------------------------
// RSDK Project: Sonic Essence
// Script Description: Background Clouds
// Script Author: Tails LP
// ----------------------------------

//-------Aliases-------//

//-------Function declarations-------//

//-------Static Values-------//

//-------Tables-------//


//-------Functions-------//


event ObjectMain
	object.drawOrder = 1
	object.priority = PRIORITY_ACTIVE
	//object.value2 = 0
end event

event ObjectDraw

		temp0 = screen.xoffset
		temp0 *= 6
		temp0 >>= 10
		temp0 &= 511
		FlipSign(temp0)
		temp0 += object.value2
		temp1 = screen.yoffset
		temp1 >>= 2
		temp1 &= 1023
		FlipSign(temp1)
		DrawSpriteScreenXY(0, temp0, temp1)
		temp0 += 512
		DrawSpriteScreenXY(0, temp0, temp1)
end event

event ObjectStartup
    	LoadSpriteSheet("SSZ/BG_Clouds.gif")
	SpriteFrame(0, 124, 512, 128, 0, 0)
	object.value2 = 496

	temp0 = screen.xcenter
	temp0 >>= 2
	object.value2 -= temp0	
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 223, 172)
end event